Skip to content

fix: use native validation for duplicate file names - #62767

Open
mvanhorn wants to merge 2 commits into
nextcloud:masterfrom
mvanhorn:fix/62686-file-creation-duplicate-validation
Open

fix: use native validation for duplicate file names#62767
mvanhorn wants to merge 2 commits into
nextcloud:masterfrom
mvanhorn:fix/62686-file-creation-duplicate-validation

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Show the duplicate-name (and other filename) error through the platform validation popup instead of the NcTextField helper. setCustomValidity still blocks Create and Enter-key submit. The helper/error bindings are dropped so the same string is not shown twice.

Same pattern as FileEntryName and PublicPageMenuExternalDialog.

Fixes #62686

@susnux susnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking for a design decision on the issue first.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

@susnux holding until the design call lands.

This PR currently does option 1: keep the NcTextField helper and drop the proactive reportValidity() call so the native tooltip doesn't double up. Enter-key submit stays blocked via setCustomValidity.

On the issue, @kra-mo leaned native if the tooltip is aligned correctly. That's the opposite of this patch. Happy to invert it (native reporting, drop the custom helper) or leave this as-is once you pick a lane.

Show the name validity through the platform validation popup instead of
the NcTextField helper text, so a duplicate name is only reported once.
This matches the existing native validation of the rename input and the
federated share dialog.

Fixes nextcloud#62686

Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
@mvanhorn mvanhorn changed the title fix: show a single duplicate-name error during file creation fix: use native validation for duplicate file names Aug 16, 2026
@mvanhorn

Copy link
Copy Markdown
Contributor Author

@susnux inverted this to option 2 after @kra-mo's lean on the issue.

reportValidity() is back, and the NcTextField no longer binds :error / :helper-text to the same string, so you get the native tooltip only. Create stays disabled and Enter still fails native validation. Same pattern as FileEntryName and PublicPageMenuExternalDialog.

Happy to flip back if designers land on the helper instead.

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Two different ' this name is already in use ' message implementations in file creation on web.

3 participants